package com.wutong.erb.entity.resource;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDateTime;

/**
 * 学习记录
 * @author wutong
 */
@Data
@TableName("learning_record")
public class LearningRecord {
    @TableId(type = IdType.INPUT)
    private Long userId;

    @TableId(type = IdType.INPUT)
    private Long resourceId;

    @TableField("progress")
    @Range(min = 0, max = 100)
    private Integer progress;

    @TableField("last_learn_time")
    private LocalDateTime lastLearnTime;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
}
